/*
 * @Author: your name
 * @Date: 2021-04-18 17:30:44
 * @LastEditTime: 2021-04-18 20:45:14
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \w1811-a-wang-xiaotong\day1\myapp\src\router\index.js
 */
import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/index.vue'
import Privacy from "../views/Privacy"
import Download from "../views/Download"
import Groping from "../views/Grouping"
import Add from "../views/Add"
import Remove from "../views/Remove"
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Index,
    redirect:"/privacy",//想打开哪个配置饿
    children:[
      {
        path:"/privacy",
        name:"私密阅读",
        icon:"smile-o",
        component:Privacy
      },
      {
        path:"/download",
        name:"下载到本地",
        icon:"down",
        component:Download
      },
      {
        path:"/grouping",
        name:"分组到...",
        icon:"qr-invalid",
        component:Groping
      },
      {
        path:"/add",
        name:"添加到书单",
        icon:"orders-o",
        component:Add
      },
      {
        path:"/remove",
        name:"移出书架",
        icon:"shrink",
        component:Remove
      }
    ]
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
